Audio frame loss recovery method and apparatus

ABSTRACT

An audio frame loss recovery method and apparatus are disclosed. In one implementation, data from some but not all audio frames is included in a redundant frame. The audio frames whose data is not included in the redundant frame may include multiple audio frames but may not include more than two consecutive audio frames. Because not all audio frames are used in the redundant frame, the amount of information needed to be transmitted in the redundant frame is reduced. A lost audio frame during transmission may be recovered from either the redundant frame when the redundant frame include data of the lost frame, or from at least one neighboring frame of the lost frame derived from either the redundant frame or the successfully transmitted audio frames when the redundant frame does not include data of the lost frame.

RELATED DISCLOSURE

This application claims priority to PCT Application No.PCT/CN2017/106640, entitled “INFORMATION CODED FRAME LOSS RECOVERYMETHOD AND APPARATUS” filed with the Chinese Patent Office on Oct. 18,2017, which claims priority to Chinese Patent Disclosure No.201610931391.8, entitled “INFORMATION CODED FRAME LOSS RECOVERY METHODAND APPARATUS” filed with the Chinese Patent Office on Oct. 31, 2016,which is incorporated herein by reference in their entireties.

FIELD OF THE TECHNOLOGY

This disclosure relates to the field of information loss recovery incommunication systems, and in particular, to an audio frame lossrecovery method and apparatus.

BACKGROUND OF THE DISCLOSURE

An audio frame (also generally referred to as an informationcoded/encoded frame, an audio data frame, and the like) includes dataobtained after segmenting an audio signal and encoding audio samples ineach segment of the audio signal based on an audio encoding scheme. Thedata format and size of an audio frame are specified by a particularaudio encoder. Segmenting an audio signal into frames may facilitatetransmission and processing of an audio data stream. Therefore, audioframes are widely applied in services such as a network streaming mediaservice and a Voice over Internet Protocol (VoIP) service. To ensurereal time quality of audio transmission, an audio frame is usuallytransmitted using a User Datagram Protocol (UDP) designed fortransmission over unreliable channels.

SUMMARY

This disclosure provides an audio frame loss recovery method andapparatus, to perform high-quality recovery on data of a lost audioframe with reduced bandwidth overhead.

In one implementation, an audio frame loss recovery method is disclosed.The method includes:

receiving a plurality of audio frames and at least one redundant frame,the plurality of audio frames including at least one first audio frameand a plurality of second audio frames, the redundant frame includingdata extracted from the plurality of second audio frames and notincluding data of the at least one first audio frame;

detecting a lost audio frame; and

obtaining, when the redundant frame includes data of the lost frame, thedata of the lost audio frame from the redundant frame, and recoveringthe lost audio frame by using the data of the lost audio frame; and

obtaining, when the plurality of audio frames and the redundant frameinclude data of a neighboring audio frame of the lost audio frame, thedata of the neighboring audio frame from the plurality of audio framesand the redundant frame, and recovering the lost audio frame by usingthe data of the neighboring audio frame.

In another implementation, an audio frame encoding method is furtherdisclosed. The method includes:

encoding an audio signal to generate a plurality of audio data frames;

determining at least one first audio frame in the plurality of audioframes as an audio frame not provided with redundant data;

generating at least one redundant frame by using data of a plurality ofsecond audio frames in the plurality of audio frames, the second audioframe being an audio frame in the plurality of audio frames other thanthe first audio frame; and

sending the plurality of audio frames and the at least one redundantframe to a decoding device.

In another implementation, an audio frame loss recovery apparatus isdisclosed. The apparatus includes a processor and a memory, the memorystoring computer-readable instructions to cause the processor to:

receive a plurality of audio frames and at least one redundant frame,the plurality of audio frames including at least one first audio frameand a plurality of second audio frames, the redundant frame includingdata extracted from the plurality of second audio frames and notincluding data of the at least one first audio frame;

detect a lost audio frame; and

obtain, when the redundant frame includes data of the lost audio frame,the data of the lost audio frame from the redundant frame, and recoverthe lost audio frame by using the data of the lost audio frame; or

obtain, when the plurality of audio frames and the redundant frameinclude data of a neighboring audio frame of the lost audio frame, thedata of the neighboring audio frame from the plurality of audio framesand the redundant frame, and recover the lost audio frame by using thedata of the neighboring audio frame.

In another implementation, an audio encoding apparatus is furtherdisclosed. The apparatus includes a processor and a memory, the memorystoring computer-readable instructions to cause the processor to:

encode an audio signal to generate a plurality of audio data frames;

determine at least one first audio frame in the plurality of audioframes as an audio frame not provided with redundant data;

generate at least one redundant frame by using data of a plurality ofsecond audio frames in the plurality of audio frames, the second audioframe being an audio frame in the plurality of audio frames other thanthe first audio frame; and

send the plurality of audio frames and the at least one redundant frameto a decoding device.

In another implementation, a non-transitory computer-readable storagemedium is disclosed for storing computer-readable instructions, and thecomputer executable instructions, when executed by a processor, causethe processor to:

receive a plurality of audio frames and at least one redundant frame,the plurality of audio frames including at least one first audio frameand a plurality of second audio frames, the redundant frame includingdata extracted from the plurality of second audio frames and notincluding data of the at least one first audio frame;

determine a lost audio frame;

obtain, when the redundant frame includes data of the lost audio frame,the data of the lost audio frame from the redundant frame, and recoverthe lost audio frame by using the data of the lost audio frame; or

obtain, when the plurality of audio frames and the redundant frameinclude data of a neighboring audio frame of the lost audio frame, thedata of the neighboring audio frame from the plurality of audio framesand the redundant frame, and recover the lost audio frame by using thedata of the neighboring audio frame.

In another implementation, a non-transitory computer-readable storagemedium is disclosed for storing computer-readable instructions, and thecomputer executable instructions, when executed by a processor, causethe processor to: encode an audio signal to generate a plurality ofaudio data frames;

determine at least one first audio frame in the plurality of audioframes as an audio frame not provided with redundant data;

generate at least one redundant frame by using data of a plurality ofsecond audio frames in the plurality of audio frames, the second audioframe being an audio frame in the plurality of audio frames other thanthe first audio frame; and

send the plurality of audio frames and the at least one redundant frameto a decoding device.

In the implementations above, only coded information of some frames isused as redundant information, so that a data volume of the requiredredundant information is reduced, and the transmission efficiency ofaudio data is improved. In addition, not only the redundant frame butalso the neighboring frame of the lost frame is used to recover the lostframe. The lost frame recovery can be achieved with high recovery ratewhile using less redundant information, reducing choppiness in audiostreaming applications.

BRIEF DESCRIPTION OF THE DRAWINGS

FIG. 1 shows a flowchart of an audio frame loss recovery method;

FIG. 2 shows a schematic logic diagram of an audio frame loss recoverymethod;

FIG. 3 shows a block diagram of an audio frame loss recovery apparatus;

FIG. 4 shows a schematic diagram of a terminal device for implementingaudio frame loss recovery;

FIG. 5a and FIG. 5b show schematic diagrams of an audio transmissionsystem;

FIG. 6 shows a flowchart of an audio frame loss recovery method; and

FIG. 7 shows a flowchart of an audio encoding method.

DESCRIPTION OF EMBODIMENTS

To clarify the technical problems to be resolved, technical solutions tothese problems, and benefits of the embodiments of this disclosure, thefollowing disclosure further describes various implementations in detailwith reference to the accompanying drawings. It should be understoodthat the specific embodiments described herein are merely used asexamples to explain this disclosure and are not intended as limitations.

FIG. 5a is a schematic diagram of an audio transmission system accordingto an embodiment of this disclosure. As shown in FIG. 5a , the systemincludes a server 50, a terminal device 52, and a network 53.

The server 50 is configured to provide an audio frame to the terminaldevice 52 through the network 53.

The terminal device 52 performs audio decoding on the received audioframe, and outputs an audio signal obtained through decoding. Theterminal device 52 may include a processor 521 and a memory 522. Thememory 522 stores an operating system 524, a network communicationsmodule 526 configured to receive and transmit data through the network,and an audio decoding module 528. The audio decoding module 528 may bestored in the memory 522 in a form of computer-executable instructions.In another embodiment, the audio decoding module 528 may alternativelybe implemented in form of hardware or a combination of hardware andsoftware.

The terminal device 52 may perform an audio frame loss recovery methodin the embodiments of this disclosure to decode audio data from theserver 50. FIG. 6 is a flowchart of an audio frame loss recovery methodaccording to an embodiment of this disclosure. As shown in FIG. 6, themethod may include the following steps.

In Step S61, the terminal device receives a plurality of audio framesand at least one redundant frame.

The plurality of audio frames include at least one first audio frame anda plurality of second audio frames. The redundant frame includes dataextracted from the plurality of second audio frames and does not includedata of the at least one first audio frame. That is, the redundant frameis generated by using the data of the plurality of second audio framesonly, and does not provide redundant data for the first audio frame.

In Step S62, the terminal device detects a lost audio frame.

In step S63, the terminal device obtain, when the redundant frameincludes data of the lost frame, the data of the lost audio frame fromthe redundant frame, and recover the lost audio frame by using the dataof the lost audio frame contained in the redundant frame.

In step S64, the terminal device obtain, when the plurality of audioframes and the redundant frame include data of a neighboring audio frameof the lost audio frame, the data of the neighboring audio frame fromthe plurality of audio frames and the redundant frame, and recover thelost audio frame by using the data of the neighboring audio frame of thelost audio frame.

In this way, only coded information of some (not all) historical framesof a current frame is used as redundant information in the redundantframe, so that a data volume of the required redundant information isreduced, and the transmission efficiency of audio data is improved. Inaddition, not only the information contained in the redundant frame, butalso a neighboring frame of the lost frame may be additionally used torecover the lost frame. Therefore, more effective lost frame recoverymay be achieved by using less redundant information, reducing the amountof pausing or transmission choppiness due to data packet loss in audiostreaming.

In some exemplary implementations, at most two first audio frames (theframes having no information in the redundant frame) that areconsecutive are selected between two sets of neighboring second audioframes (the audio frames with information included in the redundantframe) in the received plurality of audio frames, where each set ofneighboring second audio frames include at least one audio frame. Thatis, at most two consecutive frames (first frames) at an interval ofevery at least one audio frame (these audio frames being referred to assecond audio frames) do not provide data to the redundant frame. In thisway, the location and quantity of the first audio frames are designedand determined such that the probability that a lost frame cannot berecovered is reduced and a reasonable lost frame recovery rate can beachieved while using less redundant data.

In some exemplary implementations, the neighboring audio frame of a lostframe includes a previous (e.g., an immediately preceding) frame and/ora next (e.g., an immediately next) frame of the lost audio frame, andthe recovering the lost audio frame by using the data of the neighboringaudio frame includes:

setting a value of an encoding parameter of the lost audio frame to avalue between a value of the encoding parameter of the previous frameand a value of the encoding parameter of the next frame.

In some examples, the encoding parameter is at least one of a linespectral pair, a pitch period, and a gain.

In some examples, the neighboring audio frame is a previous frame or anext frame of the lost audio frame, and the recovering the lost audioframe by using the data of the neighboring audio frame includes: settinga value of an encoding parameter of the lost audio frame to a value ofthe encoding parameter of the neighboring audio frame or a preset value.

FIG. 5b is a schematic diagram of an audio transmission system accordingto another embodiment of this disclosure. The system may be applied to anetwork voice communications service, for example, an instant messagingservice or a VoIP service. As shown in FIG. 5b , the system includes afirst terminal device 51, a second terminal device 52, and a network 53.

The first terminal device 51 may collect a speech signal entered by auser, encodes the collected speech signal to obtain a speech frame, andsends the speech frame to the second terminal device 52.

The second terminal device 52 may perform an audio frame loss recoverymethod of the embodiments of this disclosure to decode speech data fromthe first terminal device 51. The second terminal device 52 is similarto the terminal device 52 in the embodiment shown in FIG. 5a . However,in some implementations, the audio decoding module 528 in FIG. 5a ispresented as a speech decoding module 529.

FIG. 7 is a flowchart of an audio encoding method according to anembodiment of this disclosure. The audio encoding method may beperformed by the first terminal device 51. As shown in FIG. 7, themethod may include the following steps.

In Step S71, the first terminal device 51 encodes an audio signal togenerate a plurality of audio data frames.

In Step S72, the first terminal device determines at least one firstaudio frame in the plurality of audio frames as an audio frame notprovided with redundant data.

In Step S73, the first terminal device generates at least one redundantframe by using data of a plurality of second audio frames in theplurality of audio frames, the second audio frame being an audio framein the plurality of audio frames other than the first audio frame.

In Step S74, the first terminal device sends the plurality of audioframes and the at least one redundant frame to a decoding device.

In this way, on an audio encoding end, the redundant data is providedfor some audio frames (rather than all audio frames) only, so that adata volume of the redundant data can be reduced, and the transmissionefficiency of audio data can be improved.

In some implementations, at least one audio frame may be selected fromthe plurality of audio frames as the first audio frame by selecting atmost two consecutive frames at an interval of every at least one audioframe. That is, at most two consecutive frames are selected as firstaudio frames (the firs audio frames do not participate in determiningthe redundant from) at an interval of every at least one audio frame(these audio frames being referred to as second audio frames). In thisway, the location and quantity of the first audio frames are controlled,so as to reduce the probability that a lost frame is not recoverable,and increase loss recovery rate using little redundant data.

FIG. 1 is a flowchart of an audio frame loss recovery method accordingto an embodiment of this disclosure. The technical solution In someimplementations may be implemented in any terminal or server. Theterminal may be a mobile terminal, for example, a mobile phone or atablet computer. The technical solution In some implementations may beused to recover audio data, video data, or the like transmitted in realtime on a client device or a data relay server in a wide range ofapplications. The method In some implementations may include thefollowing steps.

In Step S110, an electronic device may receive a plurality of audioframes and a redundant frame, the redundant frame including data of atleast one audio frame extracted at a preset interval from the pluralityof audio frames.

In some implementations, the audio frame may include a streaming audiodata or another type of data. This is not limited In someimplementations. In some implementations, the preset interval is notlimited, and may be specifically an interval of one or more frames.

In some implementations, the preset interval may be one frame or twoframes. In this way, for a lost frame, at least data for one of itsneighboring frame may be found from the redundant frame, so thatreasonable recovery of such a lost from may be achieved using at leastone of its neighboring frames.

In some implementations, when sending data, a transmitting end of theaudio data may cache streaming audio data of a plurality of historicalframes ahead of a current frame, and extract, at a frame interval, abitstream of a corresponding historical frame as the redundant frame. Insome implementations, audio frames are not be extracted consecutivelyfor obtaining the redundant frame but are obtained at an interval.Therefore, the amount of data used for the redundant frame is reduced,so that additional bandwidth needed to transmit the redundant frames iseffectively reduced.

In Step S120, the electronic device detect a lost audio frame previousto a current audio frame.

In some implementations in an exemplary social network application, aserver or relaying server of the social network or a client applicationinstalled on a terminal device may determine, based on a receivedcurrent audio frame, preceding lost audio frames, e.g., one or two lostframes preceding the current frame.

In Step S130, the device obtain data of a neighboring frame of the lostaudio frame from the current audio frame and/or the redundant frame whenthe redundant frame does not include data of the lost audio frame.

In some implementations, when the redundant frame includes data of thelost audio frame, the data may be directly used for recovery. When theredundant frame does not include the data of the lost audio frame, theneighboring frame of the lost frame may be obtained. The data of theneighboring frame may be located in the redundant frame or in thecurrent audio frame. In some implementations, the redundant frame may bedecoded by using a decoder to obtain decoded information, so as togenerate a recovery packet (that is, recovery data) either because theredundant frame contains data for the lost frame or the redundant framecontains data of a neighboring frame of the lost frame.

In Step S140, the electronic device recover data of the lost audio framebased on the data of the neighboring frame of the lost frame. In someimplementations, data of the redundant frame or the current framecorresponding to the lost frame may be decoded by using a decoder, torecover the lost frame.

In some implementations of speech transmission in a social network, thespeech may have short-time correlation and stability. Therefore, a lostframe may be relatively well recovered based on data of spaced audioframes in redundant frames. The technical solution above thus takes intoconsideration both the network work bandwidth usage by redundant frameand lost frame recoverability with relatively small amount of data,aiming at improving network transmission efficiency (reducing networkburden) while ensuring lost frame recoverability.

In another implementation of this disclosure, another audio frame lossrecovery method is provided. In this method , step S140 above mayinclude:

calculating the i^(th) line spectral pair, pitch period, or gain in thelost audio frame based on a preset first coefficient, the i^(th) linespectral pair, pitch period, or gain in a previous frame of the lostframe, and the i^(th) line spectral pair, pitch period, or gain in anext frame of the lost frame, where i is a positive integer.

In some implementations, the first coefficient is not limited to asingle preset value. Rather, it may include two preset valuesrespectively corresponding to the previous frame and the next frame ofthe lost frame.

Taking a commonly used voice encoding/decoding model, e.g., acode-excited linear prediction (CELP) model, as an example, four groupsof compressed encoding parameters including an LSP (line spectral pair),a Pitch (pitch period), a Gain (gain), and a Code (codebook), andrepresenting a frame of speech signal for a neighboring frame of thelost frame may be obtained by parsing and decoding bitstreams of thecurrent coded frame and/or the redundant frame.

In some implementations, an “interpolation” recovery method may be used.For example, the i^(th) LSP/Pitch/Gain parameter of the to-be-recoveredn^(th) lost frame is obtained by using the following interpolationprocess:

First, the bitstreams of the current encoded frame and the redundantframe are parsed to obtain the line spectral pair (LSP), Pitch (pitchperiod), Gain (gain), and Code (codebook) parameters.

LSP_int(i)(n)=a×LSP(i)(n+1)+(1−a)×LSP(i)(n−1), where n is a framesequence number, a is a weighting coefficient less than 1, and i is anLSP sequence number;

Pitch_int(n)=0.5×(Pitch(n+1)+Pitch(n−1)), where n is a frame sequencenumber; and

Gain_int(i)(n)=b×Gain(i)(n+1)+(1−b)×Gain(i)(n−1), where n is a framesequence number, b is a weighting coefficient less than 1, and i is aGain sequence number.

In some implementations, values for the coefficients a and b are notlimited by the example above, and they may be replaced with othervalues. The lost frame may be recovered with high fidelity based on dataof the previous frame and the next frame.

In another implementation of this disclosure, another audio frame lossrecovery method is provided. In this method, step S140 above mayinclude:

calculating the i^(th) line spectral pair or gain of the lost audioframe based on a preset second coefficient and the i^(th) line spectralpair or gain in a previous frame of the lost frame; and selecting largerof a preset smallest allowed value of a pitch period and a relativelylarge value of the i^(th) pitch period in the previous frame as thei^(th) pitch period of the lost audio frame, where i is a positiveinteger.

In this implementation, the second coefficient can be any predeterminedvalue within a range and is not limited to any specific preset value.

As such, an “extrapolation” recovery method is used in the implementedabove. The i^(th) LSP/Pitch/Gain parameter of the to-be-recovered n^(th)lost frame is obtained by using the following extension manner:

LSP_ext(i)(n)=LSP(i)(n−1), where n is a frame sequence number, and i isan LSP sequence number;

Pitch_ext(n)=Max(T_(low), Pitch(n−1)−1), where n is a frame sequencenumber, and T_(low) is the smallest allowed value of the pitch period;and

Gain_ext(i)(n)=c×Gain(i)(n−1), where n is a frame sequence number, c isa weighting coefficient less than 1, and i is a gain sequence number.

In some implementations, the second coefficient during LSP recovery maybe 1 (see the LSP expression above) or may be another value. The valuefor the second coefficient for LSP is not limited by this disclosure.When there are relatively many lost frames, they may be effectivelyrecovered based on the previous frames.

Based on the foregoing implementation, step S140 may further include:selecting random values as a codebooks for the lost frame. In someimplementations, the i^(th) Code (codebook) parameter of the n^(th) lostframe is obtained by using a random value manner:

Code_comp(i)(n)=Random( ).

In the implementation above, random values are selected for thecodebooks, providing a simple and fast scheme.

In the foregoing embodiments, two recovery manners of interpolation andextrapolation are described. A schematic diagram of recovery is shown inFIG. 2. That is, two neighboring frames may be provided in the currentframe and the redundant frame for interpolation recovery, and oneneighboring frame may be provided for extrapolation recovery.

As shown in FIG. 3, an embodiment of this disclosure provides an audioframe loss recovery apparatus. This technical solution may beimplemented in any terminal or server. The terminal may be a mobileterminal, for example, a mobile phone or a tablet computer. Thistechnical solution may be used to recover audio data, video data, or thelike that is transmitted in real time on a client or a server of asocial network. The apparatus may include: a receiving module 310, adetection module 320, an obtaining module 330, and a recovery module340.

The receiving module 310 is configured to receive a plurality of audioframes and a redundant frame, the redundant frame including data of atleast one audio frame extracted at a preset interval from the pluralityof audio frames. In some implementations, the audio frame may include anaudio bitstream data or another type of data. In some implementations,the preset interval may be specifically an interval of one or moreframes. In other implementations, the preset interval may be othernumber of frames.

In some implementations, the preset interval may be one frame or twoframes. In this way, for a lost frame, at least one neighboring framemay be found from the redundant frame, so as to perform data recovery,and data of the neighboring frame can provide a relatively goodrecovery.

In some implementations, when sending data, a transmit end of the audiodata caches audio bitstream data of a plurality of historical framespreceding a current frame, and extracts, at a frame interval, abitstream of a corresponding historical frame as the redundant frame. Insome implementations, audio frames are obtained at an interval togenerate the redundant frame. Therefore, the size of the redundant frameis reduced, so that bandwidth requirement reduced for transmitting theredundant frame.

The detection module 320 is configured to detect a lost audio frameprevious to a current audio frame.

Using a social network as an example, a server of the social network ora client installed on a terminal may determine, based on a receivedcurrent audio frame, preceding lost audio frames, for example, one ortwo preceding lost frames of the current frame.

The obtaining module 330 is configured to obtain data of a neighboringframe of the lost audio frame from the current audio frame and/or theredundant frame when the redundant frame does not include the lost audioframe.

In some implementations, when the redundant frame includes data of thelost audio frame, the data may be directly used for recovery. When theredundant frame does not include the data of the lost audio frame, theneighboring frames of the lost frame may be obtained. The data of theneighboring frames may be located in the redundant frame or the currentaudio frame. In some implementations, the redundant frame may be decodedby using a decoder to obtain decoded information, so as to generate arecovery frame.

The recovery module 340 is configured to recover data of the lost audioframe based on the data of the neighboring frame. In someimplementations, data of the redundant frame or the current framecorresponding to the lost frame may be decoded by using a decoder, torecover the lost frame.

In some implementations of speech transmission in a social network, thespeech has short-time correlation and stability. Therefore, a lost framecan be relatively well recovered based on data of spaced audio frames inredundant frames. The technical solution above thus takes intoconsideration both the network work bandwidth usage by redundant frameand lost frame recoverability with relatively small amount of data,aiming at improving network transmission efficiency (reducing networkburden) while ensuring lost frame recoverability.

Another implementation of this disclosure provides another audio frameloss recovery apparatus. In this implementation, the recovery module 340may calculate the i^(th) line spectral pair, pitch period, or gain inthe lost audio frame based on a preset first coefficient, the i^(th)line spectral pair, pitch period, or gain in a previous frame, and thei^(th) line spectral pair, pitch period, or gain in a next frame,wherein i is a positive integer.

In some implementations, the first coefficient is not limited a singlepreset value. Rather, it may include two values respectivelycorresponding to the previous frame and the next frame of the lastframe.

Taking a commonly used voice coding/decoding model, e.g., a code-excitedlinear prediction (CELP) coding model, as an example, four groups ofcompression coding parameters including an LSP (line spectral pair), aPitch (pitch period), a Gain (gain), and a Code (codebook), andrepresenting a frame of speech signal for a neighboring frame of thelost frame may be obtained by parsing bitstreams of the current codedframe and/or the redundant frame.

In some implementation, an “interpolation” recovery method is used. Forexample, the i^(th) LSP/Pitch/Gain parameter of the to-be-recoveredn^(th) lost frame is obtained by using the following interpolationprocess:

First, the bitstreams of the current coded frame and the redundant frameare parsed to obtain the line spectral pair (LSP), Pitch (pitch period),Gain (gain), and Code (codebook) parameters.

LSP_int(i)(n)=a×LSP(i)(n+1)+(1−a)×LSP(i)(n−1), where n is a framesequence number, a is a weighting coefficient less than 1, and i is anLSP sequence number;

Pitch_int(n)=0.5×(Pitch(n+1)+Pitch(n−1)), where n is a frame sequencenumber; and

Gain_int(i)(n)=b×Gain(i)(n+1)+(1−b)×Gain(i)(n−1), where n is a framesequence number, b is a weighting coefficient less than 1, and i is aGain sequence number.

In some implementations, values of the coefficients a and b are notlimited by the example above, and they may be replaced with anothervalues. The lost frame may be recovered with high fidelity based on dataof the previous frame and the next frame.

An embodiment of this disclosure provides another audio frame lossrecovery apparatus. In particular, the recovery module 340 may calculatethe i^(th) line spectral pair or gain of the lost audio frame based on apreset second coefficient and the i^(th) line spectral pair or gain in aprevious frame of the last frame, and select greater of a presetsmallest allowed value of a pitch period and a relatively large value ofthe i^(th) pitch period in the previous frame as the i^(th) pitch periodof the lost audio frame, where i is a positive integer.

In this implementation, the second coefficient can be any predeterminedvalue within a range and is not limited to any specific preset value.

As such, an “extrapolation” recovery method is used in the implementedabove. The i^(th) LSP/Pitch/Gain parameter of the to-be-recovered n^(th)lost frame is obtained by using the following extension manner:

LSP_ext(i)(n)=LSP(i)(n−1), where n is a frame sequence number, and i isan LSP sequence number;

Pitch_ext(n)=Max(T_(low), Pitch(n−1)−1), where n is a frame sequencenumber, and T_(low) is the smallest allowed value of the pitch period;and

Gain_ext(i)(n)=c×Gain(i)(n−1), where n is a frame sequence number, c isa weighting coefficient less than 1, and i is a gain sequence number.

In some implementations, the second coefficient during LSP recovery maybe 1 (see the LSP expression above) or may be another value. The valuefor the second coefficient for LSP is not limited by this disclosure.When there are relatively many lost frames, they may be effectivelyrecovered based on the previous frames.

Based on the foregoing embodiment, further, the recovery module 340selects a random values as codebooks for the lost frame. In someimplementations, the i^(th) Code (codebook) parameter of the n^(th) lostframe is obtained by using a random value manner:

Code_comp(i)(n)=Random( ).

In the implementation above, random values are selected for thecodebooks, providing a simple and fast scheme.

In the foregoing embodiments, two recovery manners of interpolation andextrapolation are described. A schematic diagram of recovery is shown inFIG. 2. That is, two neighboring frames may be provided in the currentframe and the redundant frame for interpolation recovery, and oneneighboring frame may be provided for extrapolation recovery.

An embodiment of this disclosure further provides another terminalconfigured to implement the audio frame loss recovery apparatus in theembodiments of this disclosure, as shown in FIG. 4. For ease ofdescription, only components related to the embodiments of thisdisclosure is shown. For a specific technical detail not disclosed,refer to the method embodiments of this disclosure. The terminal may beany terminal device including a mobile phone, a tablet computer, aPersonal Digital Assistant (PDA), a Point of Sales (POS), and avehicle-mounted computer. FIG. 4 shows an mobile phone as an example. Inparticular, FIG. 4 is a partial block diagram of a mobile phone that canbe used to implement the method described in this disclosure. Referringto FIG. 4, the mobile phone includes components such as a radiofrequency (RF) circuit 410, a memory 420, an input unit 430, a displayunit 440, a sensor 450, an audio circuit 460, a Wireless Fidelity (WiFi)module 470, a processor 480, and a power supply 490. A person ofordinary skill in the art may understand that the structure of themobile phone shown in FIG. 4 is merely exemplary and does not constituteany limitation, and the mobile phone may include more components orfewer components than those shown in the figure. Some components shownmay be combined, or a different component may be used.

The memory 420 may be configured to store a software program and module.The processor 480 runs the software program and module stored in thememory 420, to implement various functions of the mobile phone. Thememory 420 may mainly include a program storage area and a data storagearea. The program storage area may store an operating system,application programs required by at least one function (such as a soundplayback function and an image display function), and the like. The datastorage area may store data (such as audio data and an address book)created according to use of the mobile phone, and the like. In addition,the memory 420 may include a high speed random access memory, and mayfurther include a non-volatile memory, such as at least one magneticdisk storage device, a flash memory, or other volatile solid-statestorage devices.

The processor 480 is the control center of the mobile phone, and isconnected to various parts of the mobile phone by using variousinterfaces and busses. By running or executing the software programand/or module stored in the memory 420, and invoking data stored in thememory 420, the processor 880 performs various functions of the mobilephone and processes data, thereby performing overall monitoring on themobile phone.

In some implementations of this disclosure, the processor 480 includedin the terminal further provides the following function: executingcomputer-readable instructions in the memory 420 to:

receive a plurality of audio frames and a redundant frame, the redundantframe including data of at least one audio frame extracted at a presetinterval from the plurality of audio frames;

detect a lost audio frame previous to a current audio frame;

obtain data of a neighboring frame of the lost audio frame from thecurrent audio frame and the redundant frame when the redundant framedoes not include the lost audio frame; and

recover data of the lost audio frame based on the data of theneighboring frame.

This disclosure thus provide various implementation of an audio frameloss recovery. Encoded information of some frames is used as redundantinformation, and redundant information may be reduced by more than halfby only selecting information of some (not all) frames to be included inthe redundant information. For audio frames containing speech which hasshort-time correlation and stability, a lost frame can be relativelywell recovered based on data of spaced speech audio frames in redundantframes. As such, the implementation of this disclosure provide reducedbandwidth for transmitting redundant frames while achieving relativelygood lost frame recovery capability.

The foregoing describes exemplary implementations of this disclosurewith reference to the accompanying drawings. The scope of thisdisclosure is not limited by these implementations. A person of ordinaryskill in the art may make various variations to these implementationswithout departing from the spirit of this disclosure. For example, afeature of one embodiment may be combined with another embodiment toobtain still another embodiment. Any modification, equivalentreplacement, and improvement made by using the technical concept of thisdisclosure should fall within the scope of this disclosure.

What is claimed is:
 1. An audio frame loss recovery method, performed bya terminal device having a memory for storing instructions and aprocessor for executing the instructions, the method comprising:receiving a plurality of audio frames and at least one redundant frame,wherein the plurality of audio frames comprise at least one first audioframe and a plurality of second audio frames, and the redundant framecomprises data extracted from the plurality of second audio frames andwithout data from the at least one first audio frame; detecting a lostaudio frame; determining whether the redundant frame includes data fromthe lost audio frame; obtaining, when the redundant frame includes dataof the lost audio frame, the data of the lost audio frame from theredundant frame, and recovering the lost audio frame based on the dataof the lost audio frame contained in the redundant frame; and obtaining,when the plurality of audio frames and the redundant frame comprise dataof at least one neighboring audio frame of the lost audio frame, thedata of the at least one neighboring audio frame of the lost audio framefrom the plurality of audio frames and the redundant frame, andrecovering the lost audio frame based on the data of the at least oneneighboring audio frame.
 2. The method according to claim 1, wherein theat least one first audio frame contains no more than two consecutiveaudio frames from the plurality of audio frames.
 3. The method accordingto claim 1, wherein the at least one neighboring audio frame of the lostaudio frame comprises an immediately preceding frame and an immediatelynext frame of the lost audio frame, and recovering the lost audio framebased on the data of the at least one neighboring audio frame comprises:setting an encoding parameter of the lost audio frame to a value betweena value of a corresponding encoding parameter of the immediatelypreceding frame and a value of a corresponding encoding parameter of theimmediately next frame.
 4. The method according to claim 3, wherein theencoding parameter is at least one of a line spectral pair, a pitchperiod, and a gain.
 5. The method according to claim 3, wherein settingthe encoding parameter of the lost audio frame to the value between thevalue of the encoding parameter of the immediately preceding frame andthe value of the encoding parameter of the immediately next framecomprises: calculating an i^(th) line spectral pair, pitch period, orgain in the lost audio frame based on a preset first coefficient, thei^(th) line spectral pair, pitch period, or gain in the immediatelypreceding frame, and the i^(th) line spectral pair, pitch period, orgain in the immediately next frame, wherein i is a positive integer. 6.The method according to claim 1, wherein the at least one neighboringaudio frame comprises a single neighboring audio frame including animmediately preceding frame or an immediately next frame of the lostaudio frame, and the recovering the lost audio frame based on the dataof the at least one neighboring audio frames comprises: setting anencoding parameter of the lost audio frame to a value of a correspondingencoding parameter of the single neighboring audio frame or a presetvalue.
 7. The method according to claim 6, wherein setting the encodingparameter of the lost audio frame to the value of the correspondingencoding parameter of the single neighboring audio frame or the presetvalue comprises: calculating an i^(th) line spectral pair and gain ofthe lost audio frame based on a preset second coefficient and the i^(th)line spectral pair and gain in the neighboring audio frame,respectively; and selecting a preset smallest allowed value of a pitchperiod and a relatively large value of an i^(th) pitch period in thesingle neighboring audio frame as the i^(th) pitch period of the lostaudio frame, wherein i is a positive integer.
 8. The method according toclaim 1, wherein recovering the lost audio frame based on the data ofthe at least one neighboring audio frame comprises: selecting a randomvalue as a codebook for the lost audio frame.
 9. An audio encodingmethod, applied to an audio encoding device, and comprising: encoding anaudio signal to generate a plurality of audio frames; selecting at leastone first audio frame in the plurality of audio frames; generating atleast one redundant frame by using data of a plurality of second audioframes in the plurality of audio frames, each of the plurality of secondaudio frames being an audio frame among the plurality of audio framesother than the at least one first audio frame; and sending the pluralityof audio frames and the at least one redundant frame to a decodingdevice.
 10. The method according to claim 9, wherein the at least onefirst audio frame contains no more than two consecutive audio framesfrom the plurality of audio frames.
 11. An audio frame loss recoveryapparatus, comprising a memory for storing instruction and a processorin communication with the memory, wherein the processor, when executingthe instructions, is configured to: receive a plurality of audio framesand at least one redundant frame, wherein the plurality of audio framescomprise at least one first audio frame and a plurality of second audioframes, and the redundant frame comprises data extracted from theplurality of second audio frames and without data from the at least onefirst audio frame; detect a lost audio frame; determine whether theredundant frame includes data from the lost audio frame; obtain, whenthe redundant frame includes data of the lost audio frame, the data ofthe lost audio frame from the redundant frame, and recover the lostaudio frame based on the data of the lost audio frame contained in theredundant frame; and obtain, when the plurality of audio frames and theredundant frame comprise data of at least one neighboring audio frame ofthe lost audio frame, the data of the at least one neighboring audioframe of the lost audio frame from the plurality of audio frames and theredundant frame, and recover the lost audio frame based on the data ofthe at least one neighboring audio frame.
 12. The apparatus according toclaim 11, wherein the processor, when executing the instructions, isfurther configured to: obtain data of an immediately preceding frame anddata of an immediately next frame of the lost audio frame from theplurality of audio frames and the redundant frame as the data of the atleast one neighboring audio frame; and set an encoding parameter of thelost audio frame to a value between a value of a corresponding encodingparameter of the immediately preceding frame and a value of acorresponding encoding parameter of the immediately next frame.
 13. Theapparatus according to claim 11, wherein the at least one neighboringframe comprises a single neighboring audio frame including animmediately preceding frame or an immediately next frame of the lostaudio frame, and wherein the processor, when executing the instructions,is further configured to: obtain data of the single neighboring audioframe from the plurality of audio frames and the redundant frame as thedata of the at least one neighboring audio frame; and set an encodingparameter of the lost audio frame to a value of a corresponding encodingparameter of the single neighboring audio frame or a preset value. 14.The apparatus according to claim 11, wherein the processor, whenexecuting the instructions, is further configured to: select a randomvalue as a codebook for the lost audio frame.
 15. An audio encodingapparatus, comprising a memory for storing instruction and a processorin communication with the memory, wherein the processer, when executingthe instructions, is configured to: encode an audio signal to generate aplurality of audio frames; select at least one first audio frame in theplurality of audio frames; generate at least one redundant frame byusing data of a plurality of second audio frames in the plurality ofaudio frames, each of the plurality of second audio frames being anaudio frame among the plurality of audio frames other than the at leastone first audio frame; and send the plurality of audio frames and the atleast one redundant frame to a decoding device.
 16. The apparatusaccording to claim 15, wherein the at least one first audio framecontains no more than two consecutive audio frames from the plurality ofaudio frames.